# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Contributor: American_Jesus <american.jesus.pt AT gmail DOT com>

pkgname=nano-syntax-highlighting
pkgver=2020.10.10
pkgrel=1
pkgdesc="Nano editor syntax highlighting enhancements"
url="https://github.com/scopatz/nanorc"
license=('GPL3')
arch=('any')
depends=('nano')
source=("https://github.com/scopatz/nanorc/releases/download/$pkgver/nanorc-$pkgver.tar.gz")
sha256sums=('cd674e9eb230e4ba306b418c22d1891d93a3d2ffdf22234748d3398da50dfe64')

build() {
	cd "nanorc-$pkgver"
	find *.nanorc -type f | sed "s@${srcdir}\/nanorc@include \/usr\/share\/$pkgname@" > nanorc.sample
}

package() {
	cd "nanorc-$pkgver"
	mkdir -p "$pkgdir/usr/share/$pkgname"
	find . -name '*.nanorc' | xargs install -D -m644 -t "$pkgdir/usr/share/$pkgname/"
	install -D -m644 "nanorc.sample" "$pkgdir/usr/share/$pkgname/nanorc.sample"
} 


